<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: OS mode (TCPIP thread)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__lwip__os.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">OS mode (TCPIP thread)<div class="ingroups"><a class="el" href="group__lwip.html">lwIP</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gacd0a865623921ada2dd08962eb82c9df"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__os.html#gacd0a865623921ada2dd08962eb82c9df">tcpip_callback_with_block</a>(function,  ctx,  block)&#160;&#160;&#160;((block != 0)? <a class="el" href="group__lwip__os.html#gaab838fe3417ab3a1f61f0728009a0c2a">tcpip_callback</a>(function, ctx) : <a class="el" href="group__lwip__os.html#gaeb7b3c7414c76ad8dde14d2fba6cb020">tcpip_try_callback</a>(function, ctx))</td></tr>
<tr class="separator:gacd0a865623921ada2dd08962eb82c9df"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gae510f195171bed8499ae94e264a92717"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__os.html#gae510f195171bed8499ae94e264a92717">tcpip_input</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, struct <a class="el" href="structnetif.html">netif</a> *inp)</td></tr>
<tr class="separator:gae510f195171bed8499ae94e264a92717"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaab838fe3417ab3a1f61f0728009a0c2a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__os.html#gaab838fe3417ab3a1f61f0728009a0c2a">tcpip_callback</a> (<a class="el" href="tcpip_8h.html#a35203296bb838f3b493839ffc6e7285d">tcpip_callback_fn</a> function, void *ctx)</td></tr>
<tr class="separator:gaab838fe3417ab3a1f61f0728009a0c2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeb7b3c7414c76ad8dde14d2fba6cb020"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__os.html#gaeb7b3c7414c76ad8dde14d2fba6cb020">tcpip_try_callback</a> (<a class="el" href="tcpip_8h.html#a35203296bb838f3b493839ffc6e7285d">tcpip_callback_fn</a> function, void *ctx)</td></tr>
<tr class="separator:gaeb7b3c7414c76ad8dde14d2fba6cb020"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaee14fa2587a9ba9d23e4c7e16c4526ac"><td class="memItemLeft" align="right" valign="top">struct tcpip_callback_msg *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__os.html#gaee14fa2587a9ba9d23e4c7e16c4526ac">tcpip_callbackmsg_new</a> (<a class="el" href="tcpip_8h.html#a35203296bb838f3b493839ffc6e7285d">tcpip_callback_fn</a> function, void *ctx)</td></tr>
<tr class="separator:gaee14fa2587a9ba9d23e4c7e16c4526ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac5b7a59f4c3f5f721ab9ee81f231c9fd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__os.html#gac5b7a59f4c3f5f721ab9ee81f231c9fd">tcpip_callbackmsg_delete</a> (struct tcpip_callback_msg *msg)</td></tr>
<tr class="separator:gac5b7a59f4c3f5f721ab9ee81f231c9fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga83fe5fb2ea33e8c262567ac46f4db3f8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__os.html#ga83fe5fb2ea33e8c262567ac46f4db3f8">tcpip_callbackmsg_trycallback</a> (struct tcpip_callback_msg *msg)</td></tr>
<tr class="separator:ga83fe5fb2ea33e8c262567ac46f4db3f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga56a234f3d895791225c3c850bfadb666"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__os.html#ga56a234f3d895791225c3c850bfadb666">tcpip_callbackmsg_trycallback_fromisr</a> (struct tcpip_callback_msg *msg)</td></tr>
<tr class="separator:ga56a234f3d895791225c3c850bfadb666"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1f3a88b8df6ba3b9ed1c00e0a305e3db"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lwip__os.html#ga1f3a88b8df6ba3b9ed1c00e0a305e3db">tcpip_init</a> (<a class="el" href="tcpip_8h.html#a5fe07216c441e27c3028bcac60fa0992">tcpip_init_done_fn</a> initfunc, void *arg)</td></tr>
<tr class="separator:ga1f3a88b8df6ba3b9ed1c00e0a305e3db"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Use this mode if you run an OS on your system. It is recommended to use an RTOS that correctly handles priority inversion and to use <a class="el" href="group__lwip__opts__lock.html#ga8e46232794349c209e8ed4e9e7e4f011">LWIP_TCPIP_CORE_LOCKING</a>.<br />
Porting: implement all functions in <a class="el" href="group__sys__layer.html">Porting (system abstraction layer)</a>.<br />
You can use <a class="el" href="group__callbackstyle__api.html">"raw" APIs</a> together with <a class="el" href="group__lwip__os.html#gaab838fe3417ab3a1f61f0728009a0c2a">tcpip_callback</a>, and all <a class="el" href="group__sequential__api.html">Sequential-style APIs</a>. </p>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="gacd0a865623921ada2dd08962eb82c9df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacd0a865623921ada2dd08962eb82c9df">&#9670;&nbsp;</a></span>tcpip_callback_with_block</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define tcpip_callback_with_block</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">function, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ctx, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">block&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((block != 0)? <a class="el" href="group__lwip__os.html#gaab838fe3417ab3a1f61f0728009a0c2a">tcpip_callback</a>(function, ctx) : <a class="el" href="group__lwip__os.html#gaeb7b3c7414c76ad8dde14d2fba6cb020">tcpip_try_callback</a>(function, ctx))</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000005">Deprecated:</a></b></dt><dd>use <a class="el" href="group__lwip__os.html#gaeb7b3c7414c76ad8dde14d2fba6cb020">tcpip_try_callback()</a> or <a class="el" href="group__lwip__os.html#gaab838fe3417ab3a1f61f0728009a0c2a">tcpip_callback()</a> instead </dd></dl>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaab838fe3417ab3a1f61f0728009a0c2a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaab838fe3417ab3a1f61f0728009a0c2a">&#9670;&nbsp;</a></span>tcpip_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> tcpip_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="tcpip_8h.html#a35203296bb838f3b493839ffc6e7285d">tcpip_callback_fn</a>&#160;</td>
          <td class="paramname"><em>function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>ctx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Call a specific function in the thread context of tcpip_thread for easy access synchronization. A function called in that way may access lwIP core code without fearing concurrent access. Blocks until the request is posted. Must not be called from interrupt context!</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">function</td><td>the function to call </td></tr>
    <tr><td class="paramname">ctx</td><td>parameter passed to f </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if the function was called, another err_t if not</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__lwip__os.html#gaeb7b3c7414c76ad8dde14d2fba6cb020">tcpip_try_callback</a> </dd></dl>

</div>
</div>
<a id="gac5b7a59f4c3f5f721ab9ee81f231c9fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac5b7a59f4c3f5f721ab9ee81f231c9fd">&#9670;&nbsp;</a></span>tcpip_callbackmsg_delete()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tcpip_callbackmsg_delete </td>
          <td>(</td>
          <td class="paramtype">struct tcpip_callback_msg *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Free a callback message allocated by <a class="el" href="group__lwip__os.html#gaee14fa2587a9ba9d23e4c7e16c4526ac">tcpip_callbackmsg_new()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the message to free</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__lwip__os.html#gaee14fa2587a9ba9d23e4c7e16c4526ac">tcpip_callbackmsg_new()</a> </dd></dl>

</div>
</div>
<a id="gaee14fa2587a9ba9d23e4c7e16c4526ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaee14fa2587a9ba9d23e4c7e16c4526ac">&#9670;&nbsp;</a></span>tcpip_callbackmsg_new()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct tcpip_callback_msg* tcpip_callbackmsg_new </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="tcpip_8h.html#a35203296bb838f3b493839ffc6e7285d">tcpip_callback_fn</a>&#160;</td>
          <td class="paramname"><em>function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>ctx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Allocate a structure for a static callback message and initialize it. The message has a special type such that lwIP never frees it. This is intended to be used to send "static" messages from interrupt context, e.g. the message is allocated once and posted several times from an IRQ using <a class="el" href="group__lwip__os.html#ga83fe5fb2ea33e8c262567ac46f4db3f8">tcpip_callbackmsg_trycallback()</a>. Example usage: Trigger execution of an ethernet IRQ DPC routine in lwIP thread context.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">function</td><td>the function to call </td></tr>
    <tr><td class="paramname">ctx</td><td>parameter passed to function </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a struct pointer to pass to <a class="el" href="group__lwip__os.html#ga83fe5fb2ea33e8c262567ac46f4db3f8">tcpip_callbackmsg_trycallback()</a>.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__lwip__os.html#ga83fe5fb2ea33e8c262567ac46f4db3f8">tcpip_callbackmsg_trycallback()</a> </dd>
<dd>
<a class="el" href="group__lwip__os.html#gac5b7a59f4c3f5f721ab9ee81f231c9fd">tcpip_callbackmsg_delete()</a> </dd></dl>

</div>
</div>
<a id="ga83fe5fb2ea33e8c262567ac46f4db3f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga83fe5fb2ea33e8c262567ac46f4db3f8">&#9670;&nbsp;</a></span>tcpip_callbackmsg_trycallback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> tcpip_callbackmsg_trycallback </td>
          <td>(</td>
          <td class="paramtype">struct tcpip_callback_msg *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Try to post a callback-message to the tcpip_thread tcpip_mbox.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>pointer to the message to post </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__sys__mbox.html#gaa36345e48a49d67cbb0878cd4cbd2195">sys_mbox_trypost()</a> return code</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__lwip__os.html#gaee14fa2587a9ba9d23e4c7e16c4526ac">tcpip_callbackmsg_new()</a> </dd></dl>

</div>
</div>
<a id="ga56a234f3d895791225c3c850bfadb666"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga56a234f3d895791225c3c850bfadb666">&#9670;&nbsp;</a></span>tcpip_callbackmsg_trycallback_fromisr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> tcpip_callbackmsg_trycallback_fromisr </td>
          <td>(</td>
          <td class="paramtype">struct tcpip_callback_msg *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Try to post a callback-message to the tcpip_thread mbox. Same as <a class="el" href="group__lwip__os.html#ga83fe5fb2ea33e8c262567ac46f4db3f8">tcpip_callbackmsg_trycallback</a> but calls <a class="el" href="group__sys__mbox.html#gaf677a6e76adb7650a3020fdb3cb8429a">sys_mbox_trypost_fromisr()</a>, mainly to help FreeRTOS, where calls differ between task level and ISR level.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>pointer to the message to post </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__sys__mbox.html#gaf677a6e76adb7650a3020fdb3cb8429a">sys_mbox_trypost_fromisr()</a> return code (without change, so this knowledge can be used to e.g. propagate "bool needs_scheduling")</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__lwip__os.html#gaee14fa2587a9ba9d23e4c7e16c4526ac">tcpip_callbackmsg_new()</a> </dd></dl>

</div>
</div>
<a id="ga1f3a88b8df6ba3b9ed1c00e0a305e3db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1f3a88b8df6ba3b9ed1c00e0a305e3db">&#9670;&nbsp;</a></span>tcpip_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tcpip_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="tcpip_8h.html#a5fe07216c441e27c3028bcac60fa0992">tcpip_init_done_fn</a>&#160;</td>
          <td class="paramname"><em>initfunc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialize this module:</p><ul>
<li>initialize all sub modules</li>
<li>start the tcpip_thread</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">initfunc</td><td>a function to call when tcpip_thread is running and finished initializing </td></tr>
    <tr><td class="paramname">arg</td><td>argument to pass to initfunc </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gae510f195171bed8499ae94e264a92717"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae510f195171bed8499ae94e264a92717">&#9670;&nbsp;</a></span>tcpip_input()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> tcpip_input </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>inp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Pass a received packet to tcpip_thread for input processing with ethernet_input or ip_input. Don't call directly, pass to <a class="el" href="group__netif.html#gade5498543e74067f28cc6bef0209e3be">netif_add()</a> and call netif-&gt;input().</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the received packet, p-&gt;payload pointing to the Ethernet header or to an IP header (if inp doesn't have NETIF_FLAG_ETHARP or NETIF_FLAG_ETHERNET flags) </td></tr>
    <tr><td class="paramname">inp</td><td>the network interface on which the packet was received </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaeb7b3c7414c76ad8dde14d2fba6cb020"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeb7b3c7414c76ad8dde14d2fba6cb020">&#9670;&nbsp;</a></span>tcpip_try_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> tcpip_try_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="tcpip_8h.html#a35203296bb838f3b493839ffc6e7285d">tcpip_callback_fn</a>&#160;</td>
          <td class="paramname"><em>function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>ctx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Call a specific function in the thread context of tcpip_thread for easy access synchronization. A function called in that way may access lwIP core code without fearing concurrent access. Does NOT block when the request cannot be posted because the tcpip_mbox is full, but returns ERR_MEM instead. Can be called from interrupt context.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">function</td><td>the function to call </td></tr>
    <tr><td class="paramname">ctx</td><td>parameter passed to f </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if the function was called, another err_t if not</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__lwip__os.html#gaab838fe3417ab3a1f61f0728009a0c2a">tcpip_callback</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
